
// <copyright file="TimeComparer.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The time comparer.
// </summary>

namespace SubhadraSolutions.Sharp.Utils
{
    using System.Collections.Generic;

    /// <summary>
    /// The time comparer.
    /// </summary>
    public sealed class TimeComparer : IComparer<Time>
    {
        #region Static Fields

        /// <summary>
        /// The instance.
        /// </summary>
        private static readonly TimeComparer InstanceObject = new TimeComparer();

        #endregion Static Fields

        #region Constructors and Finalizers

        /// <summary>
        /// Prevents a default instance of the <see cref="TimeComparer"/> class from being created.
        /// </summary>
        private TimeComparer()
        {
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets the instance.
        /// </summary>
        public static TimeComparer Instance
        {
            get
            {
                return InstanceObject;
            }
        }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The compare.
        /// </summary>
        /// <param name="x">
        /// The x.
        /// </param>
        /// <param name="y">
        /// The y.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public int Compare(Time x, Time y)
        {
            return Time.Compare(x, y);
        }

        #endregion Public Methods and Operators
    }
}